from django.urls import include, path
from rest_framework.routers import DefaultRouter
from .views import GoodsListViewSet, CategoryViewset, BannerViewset, CategoryBarViewset, DiscountPackageViewset, \
    HotSearchsViewset, SearchAdViewset, NewGoodsViewSet, \
    HotGoodsViewSet, HighpointGoodsViewSet, ViewMoreViewSet, GoodsAttributeViewSet, GoodColorViewSet, \
    GoodsElasticSearchViewSet, DiscountPriceViewset

router = DefaultRouter()
router.register(r'goods', GoodsListViewSet, base_name='goodslist')  # 商品详情
router.register(r'color', GoodColorViewSet, base_name='goodscolor')  # 商品颜色
router.register(r'attribute', GoodsAttributeViewSet, base_name='goodsattribute')  # 商品属性
router.register(r'categorybar', CategoryBarViewset, base_name='categorybar')  # 导航栏分类
router.register(r'categoryindex', CategoryViewset, base_name='categoryindex')  # 首页分类及该分类下商品显示
router.register(r'banner', BannerViewset, base_name='banner')  # 首页轮播图
router.register(r'searchad', SearchAdViewset, base_name='searchad')  # 首页精选活动图片
router.register(r'search', GoodsElasticSearchViewSet, base_name='goodssearch')  # 首页商品搜索
router.register(r'hotsearch', HotSearchsViewset, base_name='hostsearch')  # 首页热搜词
router.register(r'newgoods', NewGoodsViewSet, base_name='newgoods')  # 新品专享页
router.register(r'hotgoods', HotGoodsViewSet, base_name='hotgoods')  # 热销榜单页
router.register(r'highpoint', HighpointGoodsViewSet, base_name='highpoint')  # 热销榜单页
router.register(r'viewmore', ViewMoreViewSet, base_name='viewmore')  # 热销榜单页
router.register(r'discount', DiscountPackageViewset, base_name='discountpackage')  # 优惠套餐
router.register(r'discountprice', DiscountPriceViewset, base_name='discountprice')  # 优惠套餐价格计算

urlpatterns = [
    # router的path路径
    path('', include(router.urls)),
]
